home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_pru_arrivalcs.cog < prev    next >
Text File  |  1999-11-15  |  6KB  |  239 lines

  1. # Jones 3D Cog Script
  2. #
  3. # PRU_arrivalCS.cog    CutScene of Indy arriving at level start.
  4. #
  5. # [GGJ]
  6. #
  7. # (C) 1998 LucasArts Entertainment Company LLC. All Rights Reserved
  8. #
  9. # ========================================================================================
  10. symbols
  11.  
  12. message    startup
  13. message    user0
  14. message    entered
  15. message activated
  16.  
  17. cog        hint
  18. cog        watersounds
  19.  
  20. keyframe    reflect=0in_figithat_4_4.key    local
  21. keyframe    transition1=0in_stand1_bd_4.key    local
  22. keyframe    transition2=0in_stand4_bd_1.key    local
  23. keyframe    getOut=ij_getup.key                local
  24.  
  25. material    topMat=jeep_top.mat                local
  26. material    botMat=jeep_bbmp.mat            local
  27.  
  28. #template    actortpl=indy_sh_actor            local
  29. template    jeepActorTpl=jeep_actor_indy    local
  30. template    emptyJeepTpl=jeepPRU            local
  31. template    raftTpl=limpraft                local
  32.  
  33. surface    lastFace        mask=0x004                        #mask lets surface know to look for an actor
  34.  
  35. thing    jeep
  36. thing    raft            local
  37. thing    jeepActor        local
  38. thing    emptyJeep        local
  39. thing    actor
  40. thing    CScamera0        nolink
  41. thing    CSTarget0
  42. thing    CSTarget1
  43. thing    CSTarget2
  44. #thing    actorGhost
  45. thing    player                local
  46. thing    tempCamSpot
  47. thing    templeBlock
  48. thing    fadePlate
  49.  
  50. sound    peru=pu01j01.wav    local        # Ah, Peru.  It's been a long time since I stood here...
  51. sound    jagSnd=fol_jg_call.wav    local
  52. sound    CSMus=mus_jep_intro.wav    local
  53. sound    jeepOffSnd=jep_engine_off.wav    local
  54.  
  55. int        tempCam                local
  56. int        once=0                local
  57.  
  58. int        bBusy=0                local
  59. int        newLine=-1            local
  60.  
  61. int        oldLine0=-1            local
  62. int        oldLine1=-1            local
  63. int        oldLine2=-1            local
  64.  
  65. int        bSeen=0                local
  66.  
  67. end
  68.  
  69. # ========================================================================================
  70. code
  71.  
  72. startup:
  73.     
  74.     SetMasterCog(GetSelfCog()); # RT: Set master cog so we get autosave/restore message
  75.  
  76.     Sleep(0.001); # Let engine get set up
  77.  
  78.     SetCameraFocus(2, CScamera0);
  79.     SetCameraSecondaryFocus(2, CSTarget0);
  80.     SetCameraLookInterp(2, 0);
  81.     SetCameraPosInterp(2, 0);
  82.     SetCurrentCamera(2);
  83.     SetCameraFOV(30, 0, 0.0);
  84.  
  85.     return;
  86.  
  87. # ..............................................................................
  88.  
  89. user0: # RT: Indicates that autosave/restore has completed...
  90.  
  91.     if (bSeen) return; # RT
  92.     bSeen = 1;
  93.  
  94.     #camera stuff should be done before anything else
  95.     SetCameraFocus(2, CScamera0);
  96.     SetCameraSecondaryFocus(2, CSTarget0);
  97.     SetCameraLookInterp(2, 0);
  98.     SetCameraPosInterp(2, 0);
  99.     SetCurrentCamera(2);
  100.     SetCameraFOV(30, 0, 0.0);
  101.  
  102.     StartCutscene(2);
  103.  
  104.     # RT: Set up jeep materials
  105.     SetMaterialCel(topMat, 1);
  106.     SetMaterialCel(botMat, 1);
  107.  
  108.     #sleep for 0.01 to generate a frame
  109.     Sleep(0.01);
  110.     
  111.     #now proceed to other stuff...    
  112.     player = GetLocalPlayerThing();
  113.     
  114.     raft = CreateThingatPos(raftTpl, GetThingSector(jeep), VectorAdd(GetThingPos(jeep), '-0.005 -0.05 -0.005'), '0 0 0');
  115.     CaptureThing(raft);
  116.     AttachThingToThingEx(raft, jeep, 0x08);
  117.  
  118.     # Turn off the player.
  119.     SetThingFlags(player, 0x80000);       
  120.     SetActorFlags(player, 0x200000);
  121.  
  122.     ThingFadeAnim(fadePlate, 1, 0, 2.0, 0);
  123.     Sleep(1.75);
  124.     SendMessage(watersounds, user5);
  125.  
  126.     SetThingThrust(jeep, '0.0 2.0 0.0');
  127.     Sleep(2.0);
  128.     MoveToFrame(CSTarget0, 1, 0.66);
  129.     SetCameraFOV(50, 1, 3.0);
  130.  
  131. return;
  132.  
  133. # .................................................................................
  134. entered:
  135.  
  136.     Print("entered");
  137.     if (GetSenderRef() != lastFace) return;
  138.     if (once != 0) return;
  139.     once = 1;
  140.     PlaySoundLocal(CSMus, 1.0, 0.0, 0x0, 0);
  141.     
  142.     StopThing(jeep);
  143.     Sleep(1.0);
  144.     jeepActor = CreateThing(jeepActortpl, jeep);
  145.     CaptureThing(jeepActor);
  146.     
  147.     CopyPlayerHolsters(player, jeepActor);
  148.  
  149.     CopyOrientandPos(Jeep, jeepActor);
  150.     
  151.     #SetThingFlags(jeep, 0x80000);
  152.     ClearThingFlags(jeepActor, 0x80000);
  153.     AttachThingToThingEx(raft, jeepActor, 0x08);
  154.     DestroyThing(jeep);
  155.     PlaySoundThing(jeepOffSnd, jeepActor, 1.0, -1.0, -1.0, 0x0);
  156.     
  157.     SendMessageEx(GetThingClassCog(jeepActor), user1, jeepActor, 0, 0, 0);
  158.     
  159.     PlayKey(jeepActor, getOut, 4, 0x12, 1);
  160.         
  161.     #make the "jeep with Indy" actor invisible
  162.     SetThingFlags(jeepActor, 0x80000);
  163.         
  164.     #create a seperate jeep thing and Indy actor
  165.     emptyJeep = CreateThing(emptyJeepTpl, jeepActor);
  166.     CaptureThing(emptyJeep);
  167.     
  168.     CopyOrientandPos(jeepActor, emptyJeep);
  169.     #actor = CreateThing(actorTpl, actorGhost);
  170.     #CaptureThing(actor);
  171.     CopyPlayerHolsters(player, actor);
  172.  
  173.     ClearThingFlags(actor, 0x80000);
  174.     AttachThingToThingEx(raft, emptyJeep, 0x08);
  175.  
  176.     #walk the actor over toward the temple
  177.     SetCameraLookInterp(2, 1);
  178.     SetCameraInterpSpeed(2, 2.6);
  179.     Sleep(0.01);
  180.     SetCameraSecondaryFocus(2, CSTarget1);
  181.     SetCameraFOV(90, 1, 1.5);
  182.     AISetLookThing(actor, templeBlock);
  183.     AISetMoveSpeed(actor, 1.0);
  184.     AISetMoveThing(actor, CSTarget2, 1);
  185.  
  186.     PlayVoice(actor, peru, 1, 0);
  187.     PlayKey(actor, transition1, 4, 0x12, 1);
  188.     PlayKey(actor, reflect, 4, 0x12, 1);
  189.     PlayKey(actor, transition2, 4, 0x12, 0);
  190.  
  191.     Sleep(0.5);
  192.  
  193.     PlaySoundLocal(jagSnd, 1.0, 0.2, 0x880, 0);
  194.     
  195.     SendMessage(watersounds, user6);
  196.     
  197.     Sleep(2.0);
  198.     
  199.     CopyOrientandPos(actor, player);
  200.     SetThingFlags(actor, 0x80000);
  201.     ClearThingFlags(player, 0x80000);       
  202.     ClearActorFlags(player, 0x200000);
  203.     
  204.     EndCutscene();
  205.     SetCameraLookInterp(2, 0);
  206.     SetCameraPosInterp(2, 0);
  207.     ResetCameraFOV(0, 0.0);
  208.  
  209.     tempCam = GetThingPos(tempCamSpot);
  210.     SetCameraPosition(1, tempCam);
  211.     SetCurrentCamera(1);
  212.  
  213.     #SendMessage(watersounds, user5);
  214.  
  215.     return;
  216.  
  217. # .................................................................................
  218. activated:
  219.  
  220.     if (GetSenderRef() == raft)
  221.     {
  222.  
  223.         # Add Repair Kit if Indy doesn't have one
  224.         ChangeInv(player, 56, 1.0);
  225.         SetInvAvailable(player, 56, 1);
  226.         SetInvDisabled(player, 56, 1);
  227.         
  228.         SetExtCamLookOffset('0.0 0.04 0.014');
  229.         SetExtCamOffset('0.1 0.01 0.12');
  230.         Sleep(1.5);
  231.         RestoreExtCam();
  232.         SendMessage(hint, user1);
  233.     }
  234.     return;
  235.  
  236. end
  237. # .................................................................................
  238.  
  239.